<template>
  <div class="person">
    <h2>当前sum: {{ sum }}</h2>
    <button @click="add">sum+1</button>
  </div>
  <button @click="getDog"> 再来一直狗</button>
  <img v-for="(item,index) in picList" :src="item" :key="index">

</template>

<script lang="ts" setup namespace="person">
// 子组件
import { ref } from 'vue'

let sum = ref(0)
function add() {
  sum.value++
}

import useDog  from '@/hooks/useDog'
const {picList,getDog} = useDog()
</script>

<style>
img {
  width: 100px;
}
</style>

